home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 223_01 / read.c < prev    next >
Text File  |  1980-01-01  |  640b  |  29 lines

  1. /*
  2. ** read.c    by F. A. Scacchitti    3/22/86
  3. */
  4.  
  5. #include <stdio.h>
  6.  
  7. extern int zzbuf;
  8.  
  9. static int i, n;
  10. static char *tbuff, flag;
  11.  
  12. read(fd,buffer,cnt) int fd, cnt; char *buffer; {
  13.  
  14.    tbuff = &zzbuf;
  15.    n=0;
  16.  
  17.     while(cnt >0){
  18.        if((flag = bdos(20,fd)) != NULL) {
  19.               *(fd + 40) = flag;
  20.           return(n);
  21.            }else 
  22.           i = 0;
  23.        while(i <= 127 && cnt > 0){ buffer[n] = tbuff[i];
  24.                i++; cnt--; n++; }
  25.     }
  26.        return(n);
  27. }
  28.  
  29.